﻿<Framework:PageViewBase
    x:Class="DeSleeper.Client.MainView"
    x:TypeArguments="Client:MainViewModel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:System="clr-namespace:System;assembly=System"
    xmlns:Framework="clr-namespace:DeSleeper.Client.Framework;assembly=DeSleeper.Client.Framework"
    xmlns:Client="clr-namespace:DeSleeper.Client" Name="_this"
    Title="MainPage">
    <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="booleanToVisibility" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="800*" />
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="200*" MinWidth="100" />
            </Grid.ColumnDefinitions>
            <TextBlock TextAlignment="Center" FontFamily="Jokerman" FontSize="100"
                       Margin="15,10" Grid.Column="0" VerticalAlignment="Center">
			    <Run Text="DeSleeper" Foreground="#FFE2F3E4" />
            </TextBlock>
            <Image Source="logo.png" Margin="0,8,16,0" MaxHeight="184" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Left" />
        </Grid>
        <Framework:CommandHistoryView Grid.Row="0" VerticalAlignment="Top"
                                      ItemsSource="{Binding ElementName=_this, Path=ViewModel.MessageProvider.Unacknowledged}" />
        <TabControl Name="tabControl" Grid.Row="1" Padding="0,0" BorderThickness="0" Margin="0, 2, 0, 0" SelectionChanged="tabControl_SelectionChanged">
            <TabItem>
                <TabItem.Header>Send Wake Up</TabItem.Header>
                <TabItem.Tag>
                    <System:Uri>Wakeup\WakeUpView.xaml</System:Uri>
                </TabItem.Tag>
            </TabItem>
            <TabItem Visibility="{Binding ElementName=_this, Path=ServiceExecutableAvailable, Converter={StaticResource booleanToVisibility}}">
                <TabItem.Header>Service Installation</TabItem.Header>
                <TabItem.Tag><System:Uri>Service\ServiceView.xaml</System:Uri></TabItem.Tag>
            </TabItem>
            <TabItem>
                <TabItem.Header>Network Card Configuration</TabItem.Header>
                <TabItem.Tag>
                    <System:Uri>SystemConfig\SystemView.xaml</System:Uri>
                </TabItem.Tag>
            </TabItem>
        </TabControl>
        <Rectangle Grid.Row="2" Fill="Gray"/>
        <Rectangle Grid.Row="2" Fill="White" Margin="2,2"/>        
        <Rectangle Grid.Row="2">
            <Rectangle.Fill>
                <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity=".8">
                    <GradientStop Color="#FF9DAFC7" Offset="0.32"/>
                    <GradientStop Color="#FF6775A3" Offset="0.64"/>
                    <GradientStop Color="#FF313B7F" Offset="0.80"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Frame Name="frame" Grid.Row="2" Margin="4,4"
               Source="Wakeup\WakeUpView.xaml"/>
    </Grid>
</Framework:PageViewBase>
